<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>入库记录</title>
    <link rel="stylesheet" href="/sb/stock.css"/>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <script src="/js/jquery-3.3.1.min.js"></script>
    <script src="/layui/layui.js"></script>

</head>
<body>
<div class="sp-wrapper">
    <h2 class="sp-title"><span>入库记录</span></h2>
    <div class="sp-tool">
        <span class="fl"><b>单据编号：[[${detail.number}]]</b>
            <b>验货日期：[[${#dates.format(detail.createTime, 'yyyy-MM-dd HH:mm:ss')}]]</b>
            <b>验货总数量：[[${detail.quantity}]]</b>
            <b>已入库：[[${detail.inQuantity}]]</b>
            <b>验货人：[[${detail.checkoutUserName}]]</b>
            <b>QC报告： <span th:if="${detail.hasQcReport == 1}">有QC报告</span>
                        <span th:if="${detail.hasQcReport == 0}">没有QC报告</span>
            </b>
            <b>状态： <span th:if="${detail.stockInStatus == 1}">已入库</span>
                        <span th:if="${detail.stockInStatus == 0}">待入库</span></b>
        </span>
        <span class="fr">
            <input type="hidden" name="StockInCheckoutId" id="StockInCheckoutId"  th:value="${StockInCheckoutId}" />
            </span>
    </div>
    <div class="sp-table">
        <form id="addf" >
        <table>
            <thead>
            <tr>
                <th>序号</th>
                <th>ID</th>
                <th>入库时间</th>
                <th>入库人</th>
                <th>入库数量</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody id="sp-data">
            <tr th:each="item:${logs}">
                <td th:text="${itemStat.index + 1}"></td>
                <td th:text="${item.id}"></td>
                <td th:text="${item.stockInTime}"></td>
                <td th:text="${item.stockInUserName}">200</td>
                <td th:text="${item.quantity}"></td>
                <td><i class="print" th:attr="data-id=${item.id}">打印入库单</i></td>
            </tr>

            </tbody>
        </table>
        </form>
    </div>
    <script type="text/javascript">
        layui.use(['laydate', 'layer'], function () {
            var laydate = layui.laydate;
            var layer = layui.layer;
            //执行一个laydate实例
            $(".print").click(function () {
                var id = $(this).attr("data-id");
                console.log(id);
                //iframe层
                layer.open({
                    type: 2,
                    title: '打印入库单',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['940px', '90%'],
                    content: '/checkout/stock_in_form?id=' + id //iframe的url
                });
            });
        });
    </script>




</div>
</body>
</html>